#ifndef GAMEACTIVITY_H
#define GAMEACTIVITY_H

#include <vector>
#include <QThread>
#include <string>
class Chess;
class ChessBoard;
class Player;
class GameRule;
class QPoint;
class ChessMethod;
class Observer;
class GameFactory;


/**
 *  abstract class of game
 *
 */
class GameActivity : public QThread{
    Q_OBJECT
public:
    virtual void onCreate();
    virtual void onStart();
    virtual void onStop();
    virtual void onReset();
    virtual void onDestroy();
    GameActivity(GameFactory*);
    virtual void addWidget(Observer *);
    virtual void addPlayer(std::string,ChessMethod*);
    virtual Player* getPlayer(std::string);
    virtual void cleanPlayer();
    virtual ChessBoard* getChessBoard();
    static bool isEnd;
    static bool isStart;
protected:

    virtual void run();
    GameFactory* _gameFactory;
    std::vector<Player*> _playerList;
    std::vector<Observer*> _widgetList;
    ChessBoard* _chessBoard;
    GameRule* _gameRule;

private:

public slots:
    virtual void notify(void);
    virtual void setPoint(int,int);

signals:
    void updateUI();

};

#endif // GAMEACTIVITY_H
